package com.amazon.ags.client.profiles;

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.RemoteException;
import android.util.Log;
import com.amazon.ags.api.AmazonGamesClient;
import com.amazon.ags.api.ErrorCode;
import com.amazon.ags.api.profiles.RequestPlayerProfileResponse;
import com.amazon.ags.client.AmazonGamesService;
import com.amazon.ags.client.GCResponseHandleImpl;

public class ProfilesServiceProxy
  implements ProfilesService
{
  private static final String FEATURE_NAME = "PROFILES";
  private static final String TAG = "PROFILES_" + ProfilesServiceProxy.class.getSimpleName();
  private final AmazonGamesClient agClient;
  private final AmazonGamesService amazonGamesService;
  private final Handler apiHandler;

  public ProfilesServiceProxy(AmazonGamesClient paramAmazonGamesClient, AmazonGamesService paramAmazonGamesService, Handler paramHandler)
  {
    this.amazonGamesService = paramAmazonGamesService;
    this.agClient = paramAmazonGamesClient;
    this.apiHandler = paramHandler;
  }

  private Bundle createRequestBundle()
  {
    return new Bundle();
  }

  public void requestLocalPlayerProfile(final GCResponseHandleImpl<RequestPlayerProfileResponse> paramGCResponseHandleImpl)
  {
    Log.d(TAG, "Request Local Player Profile called Asynchronously with handle.");
    final Message localMessage = Message.obtain();
    localMessage.what = 18;
    final ProfilesReplyMessengerFactory localProfilesReplyMessengerFactory = new ProfilesReplyMessengerFactory(this.agClient.getAppContext());
    this.apiHandler.post(new Runnable()
    {
      public void run()
      {
        localMessage.replyTo = localProfilesReplyMessengerFactory.getReplyHandleMessenger(paramGCResponseHandleImpl);
        localMessage.setData(ProfilesServiceProxy.this.createRequestBundle());
        try
        {
          ProfilesServiceProxy.this.amazonGamesService.sendMessage(localMessage);
          return;
        }
        catch (RemoteException localRemoteException)
        {
          paramGCResponseHandleImpl.setResponse(new RequestPlayerProfileResponseImp(22, ErrorCode.UNRECOVERABLE));
        }
      }
    });
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.amazon.ags.client.profiles.ProfilesServiceProxy
 * JD-Core Version:    0.6.2
 */